﻿using System;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Diagnostics;
using System.Management;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.ServiceProcess;
using System.Collections;
using System.Collections.Specialized;
using System.Threading;
using Maintenance.Util;

namespace Maintenance
{
    public partial class BigForm : Form
    {
        public enum ShowCommands
        {
            HIDE = 1,
        }

        [DllImport("shell32.dll")]
        private static extern IntPtr ShellExecute(IntPtr hwnd, string lpOperation, string lpFile,
            string lpParameters, string lpDirectory, ShowCommands nShowCmd);

        [DllImport("shell32.dll")]
        private static extern int SHEmptyRecycleBin(IntPtr handle, string root, int falgs);

        [DllImport("user32.dll")]
        private static extern bool LockWorkStation();

        private bool isMouseDown = false;
        public bool isMouseEnter = false;

        private Point mouseOffset;
        private MiniForm miniForm;

        public BigForm(MiniForm miniForm)
        {
            Control.CheckForIllegalCrossThreadCalls = false;
            InitializeComponent();
            this.miniForm = miniForm;
        }

        /*隐藏DetailsForm的定时器*/

        private void hideDetailsFormTimer_Tick(object sender, EventArgs e)
        {
            hideDetailsFormTimer.Enabled = false;
            if (!isMouseEnter && !miniForm.isMouseEnter)
            {
                this.Hide();
            }
        }

        #region 单击事件

        private void closeBtn_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        #endregion 单击事件

        private void BigForm_Load(object sender, EventArgs e)
        {
            lbl_ip.Text = GetSystemInfo.GetClientLocalIPv4Address();
        }
    }
}